package IO流;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

public class 中文练习 {
    public static void main(String[] args) throws IOException {
        String str = "你好我是小颗粒";
        FileOutputStream fos = new FileOutputStream("file文件夹//a.txt");
        byte[] bytes = str.getBytes();
        fos.write(bytes);
        fos.close();
        FileInputStream fis = new FileInputStream("file文件夹//a.txt");
        byte[] bytes1 = new byte[3];
        int len;
        while ((len = fis.read(bytes1))!=-1){
            System.out.print(new String(bytes1));
        }
    }
}
